package com.sec;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@SuppressWarnings("deprecation")
@Configuration
public class ResourceConfigAdapter extends WebMvcConfigurerAdapter {

	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		String path = System.getProperty("user.dir") + "\\src\\main\\resources\\static\\result\\";
		System.err.println("资源访问路径：" + path);
		registry.addResourceHandler("/img/**").addResourceLocations("file:" + path);
		super.addResourceHandlers(registry);
	}
}